[Top] [Prev] [Next] [Bottom]
[Contents]
Hotlists
Hotlists are treated differently than all other data sites. They require that an anchor already exist and that a Data Site is placed immediately before it. In the Bind Editor, the SaPopulateHotList or SaPopulateMasDetHotList Population Callback must be used.
Another differentiating feature of the Hotlist is that it is both a Data Site and an Activator. When the HTML document that contains the Hotlist is created, the Hotlist is a Data Site and is "populated" with detail information that is unseen by the user and visible information which the user clicks on. The Hotlist Anchor must then be bound as an Activator to define what happens when the user clicks on the Hotlist.
The first column in the results section will be the detail information that gets populated into the Hotlist item. When the Hotlist is bound as an Activator, the Project URL is added before the detail information. This detail information is used when the Hotlist item is clicked and it calls the Project URL. The detail information is the Arguments for which the Hotlist becomes the Activator.
Given data of this type:
CREATE TABLE thing
(id int, /* Unique Key */
name char(12)
description varchar(256))
Given this HTML block:
##Sa_ThingHL##<A HREF="ThingHLActivator"></A>
with which to construct the hotlist. You should follow these steps:
- 1. Press the Object Bind Editor (New Activator) button on the Project Window.
- 2. Select an anchor to be used as the Activator that generates the Hotlist.
- 3. Open the data object in the Object Bind Editor that is to be used for populating the Hotlist. Use the DSQL Data Object:
SELECT id, name FROM thing
- 4. Bind Results Columns
id
and name
to the Hotlist
- 5. In the Bind Editor, select the Template in which the Hotlist resides.
- 6. Select the
ThingHL
Data Site from the combo box list in the Results area of the Bind Editor for id
and name
.
- 7. Press the Detail button for the
id
column. This invokes the Results Detail Dialog. By having (id) first, it automatically becomes the detail information for the Hotlist. The remaining columns (name) become the visible data that the user sees in the Hotlist item.
- 8. In the Results Detail Dialog, choose SaPopulateHotlist from the combo box list of Callbacks.
- 9. Press Apply.
- 10. Press the Object Bind Editor (New Activator) button on the Project Window.
- 11. Select the Hotlist Anchor
ThingHLActivator
and press Ok.
- 12. Open the Data Object in the Bind Editor that is called when the Hotlist is processed:
SELECT name, description FROM thing WHERE id = #id,
NO_WRAP#
- 13. Select
SaGetNArg(0)
as the Argument value. This tells Sapphire/Web to use the first (0th) argument that comes across as the argument to the DSQL Object. In this case it is the Hotlist's detail information (id).
- 14. Select a Template and bind (name) and (description) to any Data Sites in it.
- 15. Apply and Test.
When the Hotlist is clicked, the Server Application will generate HTML displaying the Name and Description of the Thing in the database table.
- 1. Create an HTML document with an anchor or submit button that will activate the Server Application.
- 2. Create a "results" template with the following code in the body:
<TABLE BORDER>
<TH>##Sa_DataHotList##<A HREF="MORE"></A>
<TD> ##Sa_PlainData##
<TD> ##Sa_MorePlainData##
</TABLE>
- 3. Create a binding to the DSQL that selects the data, with the "results" page as your results template. The DSQL statement should return the unique identifier for your hot list items as the FIRST argument, then the text of your hot list, then everything else.
- 4. Within this binding, bind the unique identifier and the hotlist text to "DataHotList". Bring up the Results Detail Editor next to the unique identifier's results column. Select "SaPopulateHotList".
- 5. Bind each of the "plain data" items to their respective data drop sites.
Now you can create a binding so that the anchors go to an HTML page with more details about each of the items in the hot list.
- 1. Create a "detail" results page with one data drop site.
- 2. Make a binding from the anchor specified in your "results" page to the DSQL that selects the detail, using the "detail" HTML page you just created as the results template.
Creating a Table with Multiple Hotlists
You can have multiple hotlists in a table Some sample HTML for this, which would go on the "results" page, is as follows:
<TABLE BORDER><TH>##Sa_FirstHotList##
<A HREF="TITLES"></A>
<TD>##Sa_PlainData## <TD> ##Sa_SecondHotList##
<A HREF="ADDRESSES">
</A></TABLE>
This would create a table with the first and third columns as hot lists, and the middle column as plain data.
- 1. Change the DSQL so that it selects a unique identifier for each hot list.
- 2. Bind the first unique identifier to "FirstHotList", the second to "SecondHotList", the first anchor text to "FirstHotList", the plain text to "PlainData", and the second anchor text to "SecondHotList".
- 3. Make a binding from the first anchor ("TITLES") to a DSQL statement that selected these titles, with a "titles" detail page as the template.
- 4. Make a binding from the second anchor ("ADDRESSES") to a DSQL statement that selected these addresses, with an "addresses" detail page as the template.
Multiple Detail Information Columns in a Hotlist
A Hotlist can have more than one column of detail information. To do this:
- 1. Write your Data Object so that all the Detail Columns are first and visible columns are after the detail information.
- 2. In the Object Binding that populates the Hotlist, choose the Hotlist as the Data Site for each detail information and visible column.
- 3. Bring up the Results Detail Dialog for the first detail information column.
- 4. Choose SaPopulateHotlist as the Callback.
- 5. Type the number of detail information columns in the Client Data field as
(void*)number
and press Apply.
- 6. When creating the Data Object to use as the Activator Object Binding portion of the Hotlist, it should have arguments for each detail information column.
- 7. Bind each Argument as SaGetNArg(0), SaGetNArg(1), ... SaGetNArg(n). The detail information should correspond to your Data Object Arguments.
- 8. Bind your results to whatever Template you need.
[Top] [Prev] [Next] [Bottom]
[Contents]
info@bluestone.com
Copyright © 1997, Bluestone. All rights
reserved.